\chapter{User Interface}
This chapter will describe the GUI used to interact with the application. A clarification how to search and how to process document trough the GUI will be provided.

\section{Overview}
The application GUI can be displayed in web browsers such as Internet Explorer 8 and newer, latest Firefox, Chrome, Safari and Opera due to the features of \emph{Vaadin} framework. The main page is divided into 2 parts, see figure\ref{fig:Pattern}. Section on the left site called \emph{A} contains controls and allows user to interact with the application, right side \emph{B} is used for displaying results. The reason for this layout is to separate two different extracted knowledge. Triples and terminologies. Their function and also search logic differs and therefore it is more appropriate to allow user to search based on them separately. User would like to have the option to select list trough retrieved documents as well as see the statistics, triples and terminologies stored in them. Therefore 4 separated areas were dedicated for this purpose.

\begin{figure}[ht]
\centering
\includegraphics[width=1.1\textwidth]{./prtscrn/application.png}
\caption{Application GUI}
\label{fig:App}
\end{figure}

\section{Triples and terminologies}
Application operates with informations stored in triples and terminologies. The GUI allows user to insert text into Subject, Predicate and Object textual fields and search for triples stored in the database by clicking the \emph{Find Triple} button. The result will then be displayed in the display section \emph{B}. The result will be displayed in a table by clicking any of the cell in the table a pop up window will be displayed with the information about the resource (resource URI, lemma and textual representations). When user presses \emph{Get Detail} button, the application will search for a resource having the written textual representation or lemma and will display the results. \emph{Search Document} will trigger searching for document matching the inserted triple. Triple can have all parts specified or any parts. The result is shown in figure\ref{fig:Pattern}. However this search has been done on terminology, the result would be the same for the triples. Just over the letter \emph{B} is a list containing the documents matching the query. By clicking on any item in the list, it will display the information about the document. First line contains the document name. Document File button \emph{Download} after allows to download the document from the server to the client machine. Document text button \emph{Download} downloads the textual representation of the document. Under these buttons statistics about the document can be found. Triples, unique terms (subject, object), unique predicate and terminology counts. Such provided information allows user to see how good the IE on this document was. The document result windows contains two tables. One contains the list of triples extracted from the document and the other contains terminologies with their frequencies an TF-IDF value. \emph{Get Details and Search Document} buttons has the same effect for terminologies as for triples. By searching using the terminology, the result document list is sorted by the terminology TF-IDF value in the documents. By filled both, triple parts and terminology, it will trigger searching for document by triple and terminology. The result is then created by disjoin of each result's groups.

\section{Processing documents}
\emph{Select strategy} combo box contains all IE strategies available on the server, if an user would like to create new IE rules, he has to upload this \emph{XML} file on the server by using the File chooser under \emph{Upload Strategy Label}. File chooser under \emph{Upload Document} label allows user to select a document to process. Once the selection has been confirmed, he can invoke the processing by click the \emph{Process} button. After some time, when the linguistic processing finishes in the \emph{B} section a form will be displayed. User has the option deselect irrelevant knowledge and confirm new store by clicking \emph{Store} button. See \ref{fig:Store}.

\begin{figure}[ht]
\centering
\includegraphics[width=1.1\textwidth]{./prtscrn/store.png}
\caption{Knowledge before storing in the database}
\label{fig:Store}
\end{figure}

\section{Examples}
To demonstrate the application examples will be provided. Lets start with the document search based on terminology search, see figure\ref{fig:TermSearch}. User would like to search for a document (documents) that are about filling a reactor. User nserts text ``\emph{plnění reaktoru}'' into the terminology search text field and press \emph{Search Document} button. The result set is consisted from one file, which contains that king o knowledge. In the result tab user can see the document details. In the terminology table user can find our terminology tab on the top of the terminologies sorted by the relevance. User can assume that there is only one document having this kind of knowledge. Because the TF-IDF is high and user did not get any other results, however the other documents can contain words as ``\emph{plnění}'' and ``\emph{reaktor}'' but only in this document these two words were semantically connected.

\begin{figure}[ht]
\centering
\includegraphics[width=1.1\textwidth]{./prtscrn/reaktor.png}
\caption{Terminology search result}
\label{fig:TermSearch}
\end{figure}

Another example is about finding a triples that has some missing part. User would like to know, in which triples does a subject ``\emph{trubička}'' appears. See figure\ref{fig:TripleSearch}. User have found that the subject is presented in 6 triples, by writing the missing parts in the empty search text fields we can execute search for the document.

\begin{figure}[ht]
\centering
\includegraphics[width=1.1\textwidth]{./prtscrn/triples.png}
\caption{Search for missing triple parts}
\label{fig:TripleSearch}
\end{figure}

The last example will show document IE and its results. On the figure\ref{fig:ProcessDoc} can be seen that processed file has been ``\url{SKC_ME_0039r01y1_fin.doc}'' and we have selected ``\url{config_search.xml}'' search configuration. The result of the IE is shown on the ride side in the display part of the GUI. The document does not have that many sentences and the number of extracted triples is not high, however we have managed to extract quite a lot of terminologies and their TF-IDF relevance number shows us, that there is a lot of unique terms describing the document.

\begin{figure}[ht]
\centering
\includegraphics[width=1.1\textwidth]{./prtscrn/process1.png}
\caption{Processing a document}
\label{fig:ProcessDoc}
\end{figure}